import type { Metadata } from "next"; import Link from "next/link"; import { Kv, Page, PageHeader } from "@/components/ui/section"; import { StatusBadge } from "@/components/ui/status-badge"; import { api } from "@/lib/api"; import { EVENT_TYPE_LABEL, formatDateTime, instrumentHref } from "@/lib/format"; import type { MarketEvent } from "@/lib/types"; export const dynamic = "force-dynamic"; export async function generateMetadata({ params }: { params: Promise<{ id: string }> }): Promise { const { id } = await params; try { const e = await api(`/v1/events/${encodeURIComponent(id)}`); return { title: e.title, description: e.summary ?? `${EVENT_TYPE_LABEL[e.type] ?? e.type} event recorded by Market Atlas.`, alternates: { canonical: `/events/${e.id}` }, robots: { index: false } }; } catch { return { title: "Event" }; } } export default async function EventPage({ params }: { params: Promise<{ id: string }> }) { const { id } = await params; const e = await api(`/v1/events/${encodeURIComponent(id)}`); const url = typeof e.data.url === "string" ? (e.data.url as string) : null; return ( Events · {EVENT_TYPE_LABEL[e.type] ?? e.type} } title={e.title} lead={e.summary ?? undefined} actions={} />

Event data

v != null && typeof v !== "object") .map(([k, v]) => [k.replace(/_/g, " "), String(v)] as [string, string])} /> {Object.values(e.data).some((v) => v && typeof v === "object") &&
{JSON.stringify(Object.fromEntries(Object.entries(e.data).filter(([, v]) => v && typeof v === "object")), null, 2)}
} {url && ( Open source document ↗ )}
); }